export function debounce(fn, delay){
  let timer = null;
  return function (...args){
    clearTimeout(timer);
    let that = this;
    timer = setTimeout(() => {
      fn.apply(that, args);
    }, delay)
  }
}